package com.torry.edss.domain.valueobject;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

@AllArgsConstructor
@Getter
public enum QuantityType {
    /**
     *
     */
    MAGNIFY(1, "放量"),
    SHRINK(2, "缩量"),
    EQUALITY(3, "平量"),
    ;

    private Integer code;
    private String decr;


    public static QuantityType parse(Integer code) {
        return Objects.isNull(code) ? null : Arrays.stream(QuantityType.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }
}
